﻿//  Copyright (c) 2011 Ray Liang (http://www.dotnetage.com)
//  Dual licensed under the MIT and GPL licenses:
//  http://www.opensource.org/licenses/mit-license.php
//  http://www.gnu.org/licenses/gpl.html

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DNA.Mvc
{
    /// <summary>
    /// Defines the component could be contains children ViewComponents.
    /// </summary>
    /// <typeparam name="TComponent"></typeparam>
    public interface IComponentItemContainer<TComponent>
     where   TComponent:ViewComponent
    {
        /// <summary>
        /// Gets the children components
        /// </summary>
        IList<TComponent> Items { get; }

        /// <summary>
        /// Trigger when children component added.
        /// </summary>
        /// <param name="item"></param>
        void OnItemAdded(TComponent item);
    }

    /// <summary>
    /// Defines the container contains data object.
    /// </summary>
    /// <typeparam name="TModel"></typeparam>
    public interface IDataItemContainer<TModel>
        where TModel:class
    {
        TModel DataItem { get; set; }
    }
}
